package itdfq.ydd.Structural_Patterns.danli;

/**
 * @Author GocChin
 * @Date 2021/5/3 16:34
 * @Blog: itdfq.com
 * @QQ: 909256107
 */
public class PhoneProxy implements AbstractPhone{

    private Real real = new Real();
    private int id=0;

    @Override
    public void sell() {
        if (id==0){
            System.out.println("对不起，您无法直接从手机厂买手机");
        }else {
            real.sell();
        }
    }

    @Override
    public void set(int id) {
        this.id=id;
    }
}
